<div class="nav-top">
    <div class="top">
        <div class="top-left">
            {$settingTopTips}
        </div>
        <ul class="top-right">
            <li style="margin-right: 8px;">
                <a class="add-favorite" href="javascript:void(0)" onclick="addFavorite(document.title,window.location)" style="color: #757575" title="加入收藏，方便下次打开">加入收藏</a>
            </li>
            <li>
                <a class="header-service" target="_blank" href="http://wpa.qq.com/msgrd?v=3&amp;uin=895275392&amp;site=qq&amp;menu=yes" style="color: #757575" title="反馈投诉">反馈投诉</a>
            </li>
        </ul>
        <div class="clear"></div>
    </div>
</div>
<div style="opacity: 1;">
    <div>
        <header class="header">
            <div  class="header_search">
                <a  href="/index.html" class="logo">
                    {notempty name='settingLogo'}<img src="{$settingLogo}" alt="{$settingName}" title="{$settingName}">{else/}<img src="/static/image/logo.png" alt="{$settingName}" title="{$settingName}">{/notempty}
                </a>

                <div class="search">
                    <div class="tag">
                        <a class="active">淘宝</a>
                    </div>
                    <div  class="search-form">
                        <input type="text" maxlength="100" name="keyword" placeholder="请输入商品关键词">
                        <a class="close">
                            <i class="iconfont icon-close" style="display: none;"></i></a>
                        <button id="search"> 搜 索</button>
                    </div>
                    <div  class="search-list">
                        {volist name="hotKeywords" id="value"}
                        {if condition="$key < 9"}
                        <a href="/search.html?keyword={$value}">{$value}</a>
                        {/if}
                        {/volist}
                    </div>
                </div>
            </div>
            <nav  class="nav">
                <ul >
                    <li{eq name="currentController" value="Index"} class="active"{/eq}>
                        <a title="页" href="/index.html">首 页</a>
                    </li>
                    <li{eq name="currentController" value="Recommend"} class="active"{/eq}>
                        <a title="精选好货" href="/recommend.html">精选好货</a>
                    </li>
                    <li{eq name="currentController" value="Nine"} class="active"{/eq}>
                    <a title="九块九包邮" href="/nine.html">九块九包邮</a>
                    </li>
                    {volist name='categoryList' id='one'}
                    <li{notempty name="cid"}{eq name="cid" value="$one['id']"} class="active"{/eq}{/notempty}>
                        <a href="{:url('/category/' . $one->id)}" class="">{$one.name}</a>
                    </li>
                    {/volist}
<!--                    <li  class="tip_area" style="right: 0px;"></li>-->
                </ul>
            </nav>
        </header>
    </div>
</div>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript">
    $("input[name='keyword']").on('keydown', function (event) {
        let keyword = $("input[name='keyword']").val();
        if (event.keyCode === 13) {
            if (keyword === '') {
                return false;
            }
            location.href =  '/search.html?keyword=' + keyword;
            return false;
        }
    });
    $("#search").on('click', function () {
        let keyword = $("input[name='keyword']").val();
        if (keyword !== '') {
            location.href =  '/search.html?keyword=' + keyword;
            return false;
        }
    });
    // 加入收藏 兼容360和IE6
    function addFavorite(title, url) {
        try {
            window.external.addFavorite(url, title);
        }
        catch (e) {
            try {
                window.sidebar.addPanel(title, url, "");
            }
            catch (e) {
                alert("加入收藏失败，请使用Ctrl+D进行添加");
            }
        }
    }
</script>